﻿using System.Collections.Generic;
using WebShop.Contracts;

namespace WebShop.ViewModels
{
    public class ShoppingCartViewModel
    {
        public Order Order { get; set; }
        public ProductsInCart ProductsInCart { get; set; }

        public ShoppingCartViewModel()
        {
            ProductsInCart.EditableCart = false;
        }

        public ShoppingCartViewModel(Order order, List<ProductInCart> productsInCart, bool editableCart = false)
        {
            Order = order;
            ProductsInCart = new ProductsInCart(productsInCart, editableCart);
        }
    }

    public class ProductsInCart
    {
        public ProductsInCart()
        {
            EditableCart = false;
        }

        public ProductsInCart(List<ProductInCart> products, bool editableCart = false)
        {
            Products = products;
            EditableCart = editableCart;
        }
        public List<ProductInCart> Products { get; set; }
        public bool EditableCart { get; set; }
    }
}